package game;

import hibernateUtil.UserinfoDao;
import io.ClientSession;
import io.OperationResponse;
import io.UseMoneyParams;
import io.UseMoneyType;

import java.util.HashMap;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import platform.AppConfig;
import player.Player;
import protocol.OpCode;
import protocol.ParameterType;
import protocol.ReturnCode;
import MemoryDB.YuanTable;
import Public.PlayerAttributesFunction;
import Public.PlayerPublicFun;
import Public.PublicData;
import Public.PublicFunction;
import Public.RefObject;
import encouragement.EncourageAll;
import encouragement.OpenChest;

/**
 * 
 * @author zhengjiangyu
 * 
 */
public class BloodMoneySong {
	protected static final Logger log = LoggerFactory
			.getLogger(BloodMoneySong.class);
	public static int[] soul={30,38,45,53,60};
	public static int[] blood={20,25,29,32,34};

	public static final void UseMoneySong(Short useType, int num1, int num2,
			String itemID, Player player, ClientSession session) {
		try {

			if (player.myTable != null) {
				java.util.HashMap<Short, Object> dicSend = new HashMap<Short, Object>();
				dicSend.put(UseMoneyParams.UseMoneyType, useType);
				java.util.HashMap<String, String> tempParms = new HashMap<String, String>();
				int cGold = 0;
				int cBlood = 0;
				int cMarrowIron = 0;
				int cMarrowGold = 0;
 
				int[] costMoney = null;
				switch (useType) {
				case UseMoneyType.Non:
					
					break;
				
				case UseMoneyType.Sell1:

					break;
					//洗技能偏向
				case UseMoneyType.WashAttributePoints:
					int time=0;
					time=player.myTable.getWashAttributePoints();
					if(time==0){
						cBlood = 200;
					}else {
						if(time>=4){
							cBlood=600;
						}else {
							cBlood=100+time*100;
						}
					}
					player.myTable.setWashAttributePoints(time+1);
					tempParms.put("WashAttributePoints", player.myTable.getWashAttributePoints()
							.toString());
					break;
					//转职
				case UseMoneyType.SaveBranch:
					cBlood = 600;
					break;
				case UseMoneyType.YesBuyCard:
					break;
				case UseMoneyType.YesDoCD:
					cBlood = num1;
					break;
				case UseMoneyType.Sell:

					costMoney = PlayerAttributesFunction.GetCostMoney(itemID,
							num1);
					cGold = costMoney[0] * (-1) + costMoney[1] * 500 * (-1);
					if(cGold*-1>20000){
						cGold=-20000;
					}
					break;
				case UseMoneyType.Buy:
					break;
				case UseMoneyType.YesOpenCangKu:
					cBlood = num1 * 10;
					break;
				case UseMoneyType.CostGold:
					cGold = num1;
					break;
				case UseMoneyType.OpenSpreeItemAsID:
					costMoney = SendPack.GetCostMoneyInTablePacks(itemID);
					cGold = costMoney[0] * (-1);
					cBlood = costMoney[1] * (-1);

					cMarrowIron = costMoney[2];
					cMarrowGold = costMoney[3];
					break;
				case UseMoneyType.YesOpenPackage:
					cBlood = num1 * 10;
					break;
				case UseMoneyType.YAddGold:
					cGold = num1 * (-1);
					break;
				case UseMoneyType.YAddBlood:
					cBlood = num1 * (-1);
					break;
				case UseMoneyType.YesPVP8Times:
					cBlood = 5;
					break;
				case UseMoneyType.YesPVPTimes:
					cBlood = 5;
					break;
				case UseMoneyType.Resurrection2:
					cGold = new Double((Double.parseDouble(Integer
							.toString(num1 / 2)) + 0.8) * 2000).intValue();
					break;
				case UseMoneyType.Resurrection3:
					cBlood = 100;
					break;
				case UseMoneyType.mmm31:
					cBlood = -60;
					break;
				case UseMoneyType.mmm32:
					cBlood = -200;
					break;
				case UseMoneyType.mmm33:
					cBlood = -900;
					break;
				case UseMoneyType.mmm34:
					cBlood = -3500;
					break;
				case UseMoneyType.UpDateOneSkill:
					cGold = num1 * num1 * 100;
					break;
				case UseMoneyType.SKILLDeviation:
					cBlood = num1*15;
					break;
				case UseMoneyType.UpDateOneSoulItemSkill://魔魂技能升级公式
					//INT((魔魂技能等级/2)^2*20) 技能公式等同于下面的直接数值cGold

					cGold = num1*num1*5;
					// cGold = num1 * num2 * 200;
					
					break;
				case UseMoneyType.ButtonBuildSoulAndDigest:
						cBlood=blood[num1-1];
						if(itemID.equals("1")){
							cBlood+=100;
						}
						player.myTable.setSoul(player.myTable.getSoul()-soul[num1-1]);
						dicSend.put(UseMoneyType.SoulAndDigestGold, soul[num1-1]);
						tempParms.put("Soul", player.myTable.getSoul()
								.toString());
//					SetBuildSDCostMoney();
//					cGold = BuildSDCostMoney[num1];
					break;
				case UseMoneyType.SoulAndDigestGold:
					cGold = (150 * num1 * num2 / 5)*(-1);
					break;
				case UseMoneyType.NumDigestButtonsPlus:
					cBlood = 5;
					break;
				case UseMoneyType.PlusBottle:
					cGold = num1 * num1 * num2 + 99;
					break;
				case UseMoneyType.ApplyPickup1:
					break;
				case UseMoneyType.ApplyPickup2:
					break;
				case UseMoneyType.TaskDone:
					break;
				case UseMoneyType.SpendingReturns11:
					cGold = num1 * 200;
					break;
				case UseMoneyType.RaidsStart:
					cBlood = 10;
					break;
				case UseMoneyType.CostRaidsNow:
					cBlood = num1;
					break;
				case UseMoneyType.Cost:
					break;
				case UseMoneyType.UpLevelBottle:
					cBlood = num1 * 10;
					break;
				case UseMoneyType.PlusBottle1:
					cGold = num1 * num2 * 5 + 300;
					break;

				case UseMoneyType.FullBottle:
					cBlood=num1*10;
					if(num1>=10){
						cBlood=100;
					}
					break;
				case UseMoneyType.YesReturn:
					cBlood = 2;
					break;
				case UseMoneyType.YesManufacture:
					cBlood = 20;
					break;
				case UseMoneyType.YesSoul:
					cBlood = 30;
					break;
				case UseMoneyType.YesGem:
					cBlood = 50;
					break;
				case UseMoneyType.YesDuplicate:
					cBlood = 50;
					break;
				case UseMoneyType.YesResetPVP:
					cBlood = 20;
					int ddd=player.myTable.getPvPYingmoTimes()-1;
					if(ddd<0){
						ddd=0;
					}
					player.myTable.setPvPYingmoTimes(ddd);	
					tempParms
					.put("PvPYingmoTimes", player.myTable.getPvPYingmoTimes().toString());
					break;
				case UseMoneyType.yesCook:
					cBlood = 2;
					break;
				case UseMoneyType.YesBuy:
					cBlood = 50;
					break;
				case UseMoneyType.Getreward:

					cGold = (num1 * 20 * (int) (50 * Math.random() + 50) / 100)
							* (-1);
					break;
				// case UseMoneyType.doneCard:
				// break;
				case UseMoneyType.BenefitsSalaries: {
					if (player.myTable.getCanSalaries().toString().equals("1")) {
						cGold = -1 * EncourageAll.benefitsSalaries
								* player.myTable.getPlayerLevel();
						int guildGold = -1 * EncourageAll.benefitsGuild
								* player.myTable.getGuildContribution();
						cGold = cGold + guildGold;

						player.myTable.setCanSalaries(0);
						tempParms.put("CanSalaries", player.myTable
								.getCanSalaries().toString());

						player.myTable.setAimGetLogin(player.myTable
								.getAimGetLogin() + 1);
						tempParms.put("AimGetLogin", player.myTable
								.getAimGetLogin().toString());
					} else {
						OperationResponse operationResponse2 = new OperationResponse(
								OpCode.UseMoney, dicSend, ReturnCode.No, "");
						session.SendOperationResponse(operationResponse2);
					}
				}
					break;
				case UseMoneyType.BenefitsRank: {
					if (player.myTable.getCanRankBenefits().toString()
							.equals("1")) {
						cGold = -1 * EncourageAll.benefitsRank
								* player.myTable.getRank();
						player.myTable.setCanRankBenefits(0);
						tempParms.put("CanRankBenefits", player.myTable
								.getCanRankBenefits().toString());
					} else {
						OperationResponse response = new OperationResponse(
								OpCode.UseMoney, dicSend, ReturnCode.No, "");
						session.SendOperationResponse(response);
					}
				}
					break;
				case UseMoneyType.BenefitsGuild: {
					if (player.myTable.getCanGuildBenefits().toString()
							.equals("1")) {
						cGold = -1 * EncourageAll.benefitsGuild
								* player.myTable.getGuildContribution();
						player.myTable.setCanGuildBenefits(0);
						tempParms.put("CanGuildBenefits", player.myTable
								.getCanGuildBenefits().toString());
					} else {
						OperationResponse response = new OperationResponse(
								OpCode.UseMoney, dicSend, ReturnCode.No, "");
						session.SendOperationResponse(response);
					}
				}
					break;

				case UseMoneyType.OpenChest: {
					int boxNum = Integer.parseInt(itemID);
					if (boxNum >= 0 || -1 == boxNum) {
						OpenChest openChest = new OpenChest();
						openChest.GetChest(dicSend, session, boxNum);
					}

					return;
				}
				case UseMoneyType.PlayerInvite: {
					UserinfoDao userinfoDao = new UserinfoDao();
					YuanTable dtPass = userinfoDao
							.GetUserinfoForTableByUid(player.myTable
									.getUserInfo_userId());
					if (dtPass != null && dtPass.getRows().size() > 0) {
						boolean isNotEmpty = !dtPass.getRows().get(0)
								.getItem("Inviter").toString().equals("");
						boolean isNotZero = Integer.parseInt(dtPass.getRows()
								.get(0).getItem("Inviter").toString()) > 0;
						if (isNotEmpty && isNotZero) {
							cGold = -1 * EncourageAll.inviteGold;
							cBlood = -1 * EncourageAll.inviteBlood;
							userinfoDao.upDateUserInfoInviter(player.myTable
									.getUserInfo_userId());
						} else {
							OperationResponse response = new OperationResponse(
									OpCode.UseMoney, dicSend, ReturnCode.No, "");
							session.SendOperationResponse(response);
						}
					} else {
						OperationResponse response = new OperationResponse(
								OpCode.UseMoney, dicSend, ReturnCode.Nothing,
								"");
						session.SendOperationResponse(response);
					}
				}
					break;
				case UseMoneyType.PlayerInvitees: {
					UserinfoDao userinfoDao = new UserinfoDao();
					YuanTable dtPass = userinfoDao
							.GetUserinfoForTableByUid(player.myTable
									.getUserInfo_userId());
					if (dtPass != null && dtPass.getRows().size() > 0) {
						boolean isNotEmpty = !dtPass.getRows().get(0)
								.getItem("Inviter").toString().equals("");
						boolean isNotZero = Integer.parseInt(dtPass.getRows()
								.get(0).getItem("Inviter").toString()) > 0;
						if (isNotEmpty && isNotZero) {
							cGold = -1 * EncourageAll.inviteesGold;
							cBlood = -1 * EncourageAll.inviteesBlood;
							userinfoDao.upDateUserInfoInvitees(player.myTable
									.getUserInfo_userId());
						} else {
							OperationResponse response = new OperationResponse(
									OpCode.UseMoney, dicSend, ReturnCode.No, "");
							session.SendOperationResponse(response);
						}
					} else {
						OperationResponse response = new OperationResponse(
								OpCode.UseMoney, dicSend, ReturnCode.Nothing,
								"");
						session.SendOperationResponse(response);
					}
				}
					break;
				case UseMoneyType.MakeGold: {
					int a = 0;
					int b=0;
					//int b = num2 * -1;
					
					YuanTable vip = PlayerPublicFun.pubPlayerService.get(Integer.toString(num2));
					YuanTable myVip=PlayerPublicFun.pubPlayerService.get(player.myTable.getServing());
					if(vip!=null)
					{
						if(Integer.parseInt(player.myTable.getServing())>=Integer.parseInt(vip.getItem(0).getItem("VIPType").getYuanColumnText()))
						{
							
							if(player.myTable.getUseMakeGold()<Integer.parseInt(myVip.getItem(0).getItem("canMakeGold").getYuanColumnText()))
							{
								b=Integer.parseInt(vip.getItem(0).getItem("blood").getYuanColumnText())*-1;
								int tempNum = PlayerAttributesFunction.UseAnalyseMoney(a,
										b, player.myTable);
								if (tempNum == 1) 
								{
									OperationResponse response = new OperationResponse(OpCode.UseMoney, dicSend, ReturnCode.NoGold, "");
									session.SendOperationResponse(response);
									return;
								} 
								else if (tempNum == 2) 
								{
									OperationResponse response = new OperationResponse(OpCode.UseMoney, dicSend,ReturnCode.NoBloodStone, "");
									session.SendOperationResponse(response);
									return;
								}
								cGold=Integer.parseInt(vip.getItem(0).getItem("gold").getYuanColumnText())*-1;
								player.myTable.setUseMakeGold(player.myTable.getUseMakeGold()+1);
								tempParms.put("useMakeGold", player.myTable.getUseMakeGold()
										.toString());
								
								player.myTable.setAimMakeGold(player.myTable.getAimMakeGold()+1);//每日目标炼金
								tempParms.put("AimMakeGold", player.myTable.getAimMakeGold().toString());
							}
							else
							{
								//使用次数已达到上限
								OperationResponse response = new OperationResponse(OpCode.UseMoney, dicSend,ReturnCode.NoNum, "");
								session.SendOperationResponse(response);
								return;
							}
							
							//cGold = PlayerPublicFun.makeGold.CanMakeGold(num2) * -1;
						}
						else 
						{
							//当前VIP等级没达到
							OperationResponse response = new OperationResponse(
									OpCode.UseMoney, dicSend,
									ReturnCode.NoSlot, "");
							session.SendOperationResponse(response);
							return;
						}
					}
					else
					{
						//当前VIP等级没达到
						OperationResponse response = new OperationResponse(
								OpCode.UseMoney, dicSend,
								ReturnCode.NoSlot, "");
						session.SendOperationResponse(response);
						return;
					}

				}
					break;
				case UseMoneyType.InviteGoPVE: {
					cBlood = 50;
				}
					break;
				case UseMoneyType.PRECIOUS: {
					cBlood = 5;
				}
					break;

				default: {
					return;
				}
				
				}
				cGold = cGold * -1;
				cBlood = cBlood * -1;
				// int num = PlayerAttributesFunction.UseAnalyseMoney(cGold,
				// cBlood, player.myTable);
				int num = PlayerAttributesFunction.UseAnalyseMarrow(cGold,
						cBlood, cMarrowIron, cMarrowGold, player.myTable);

				if (num == 1) {
					OperationResponse operationResponse2 = new OperationResponse(
							OpCode.UseMoney, dicSend, ReturnCode.NoGold, "");
					session.SendOperationResponse(operationResponse2);
					return;
				} else if (num == 2) {
					OperationResponse operationResponse2 = new OperationResponse(
							OpCode.UseMoney, dicSend, ReturnCode.NoBloodStone,
							"");
					session.SendOperationResponse(operationResponse2);
					return;
				} else if (num == -1) {
					OperationResponse operationResponse2 = new OperationResponse(
							OpCode.UseMoney, dicSend, ReturnCode.NoMarrowIron,
							"");
					session.SendOperationResponse(operationResponse2);
					return;
				} else if (num == -2) {
					OperationResponse operationResponse2 = new OperationResponse(
							OpCode.UseMoney, dicSend, ReturnCode.NoMarrowGold,
							"");
					session.SendOperationResponse(operationResponse2);
					return;
				} else if (num == 0) {
					if (useType == UseMoneyType.UpLevelBottle) {
						PlayerAttributesFunction.AddSolutionLevel(player);
						tempParms.put("SolutionLevel", player.myTable
								.getSolutionLevel().toString());
					} else if (useType == UseMoneyType.PlusBottle1) {
						PlayerAttributesFunction.AddSolutionNum(1, player);
						tempParms.put("SolutionNum", player.myTable
								.getSolutionNum().toString());
					}
					tempParms
							.put("Money", player.myTable.getMoney().toString());
					tempParms.put("Bloodstone", player.myTable.getBloodstone()
							.toString());

					tempParms.put("MarrowIron", player.myTable.getMarrowIron()
							.toString());
					tempParms.put("MarrowGold", player.myTable.getMarrowGold()
							.toString());
					
					

					String[] strKey = null;
					String[] strValue = null;
					RefObject<String[]> refStrKey = new RefObject<String[]>(
							strKey);
					RefObject<String[]> refStrValue = new RefObject<String[]>(
							strValue);
					PublicFunction.SetTable(tempParms, refStrKey, refStrValue,
							UseMoneyParams.TableKey,
							UseMoneyParams.shortTableSql, dicSend);
					strKey = refStrKey.argvalue;
					strValue = refStrValue.argvalue;
					dicSend.put(UseMoneyParams.GoldNum, cGold);
					dicSend.put(UseMoneyParams.BloodNum, cBlood);
					dicSend.put(ParameterType.MarrowIron, cMarrowIron);
					dicSend.put(ParameterType.MarrowGold, cMarrowGold);
					
					OperationResponse operationResponse2 = new OperationResponse(
							OpCode.UseMoney, dicSend, ReturnCode.Yes, "");
					session.SendOperationResponse(operationResponse2);
				}

			} else {
				PlayerAttributesFunction.DataNoSave(session);
			}
		} catch (Exception e) {
			log.info("bloodmoneysong error" + e.toString());
		}
	}

	public static PersonSkill[] costPersonSkills;

	static void SetCostPersonSkills() {
		if (costPersonSkills == null) {
			costPersonSkills = new PersonSkill[23];

			for (int i = 0; i < costPersonSkills.length; i++) {
				costPersonSkills[i] = new PersonSkill();
			}

			costPersonSkills[0].gold[0] = 0;
			costPersonSkills[0].gold[1] = 1000;
			costPersonSkills[0].gold[2] = 10000;
			costPersonSkills[0].blood[0] = 0;
			costPersonSkills[0].blood[1] = 0;
			costPersonSkills[0].blood[2] = 0;
			costPersonSkills[1].gold[0] = 200;
			costPersonSkills[1].gold[1] = 1000;
			costPersonSkills[1].gold[2] = 10000;
			costPersonSkills[1].blood[0] = 0;
			costPersonSkills[1].blood[1] = 0;
			costPersonSkills[1].blood[2] = 0;
			costPersonSkills[2].gold[0] = 200;
			costPersonSkills[2].gold[1] = 2000;
			costPersonSkills[2].gold[2] = 10000;
			costPersonSkills[2].blood[0] = 0;
			costPersonSkills[2].blood[1] = 0;
			costPersonSkills[2].blood[2] = 0;
			costPersonSkills[3].gold[0] = 200;
			costPersonSkills[3].gold[1] = 1000;
			costPersonSkills[3].gold[2] = 10000;
			costPersonSkills[3].blood[0] = 2;
			costPersonSkills[3].blood[1] = 20;
			costPersonSkills[3].blood[2] = 100;
			costPersonSkills[4].gold[0] = 200;
			costPersonSkills[4].gold[1] = 1000;
			costPersonSkills[4].gold[2] = 10000;
			costPersonSkills[4].blood[0] = 2;
			costPersonSkills[4].blood[1] = 20;
			costPersonSkills[4].blood[2] = 100;
			costPersonSkills[5].gold[0] = 200;
			costPersonSkills[5].gold[1] = 1000;
			costPersonSkills[5].gold[2] = 10000;
			costPersonSkills[5].blood[0] = 2;
			costPersonSkills[5].blood[1] = 20;
			costPersonSkills[5].blood[2] = 100;
			costPersonSkills[6].gold[0] = 200;
			costPersonSkills[6].gold[1] = 1000;
			costPersonSkills[6].gold[2] = 10000;
			costPersonSkills[6].blood[0] = 2;
			costPersonSkills[6].blood[1] = 20;
			costPersonSkills[6].blood[2] = 100;
			costPersonSkills[7].gold[0] = 200;
			costPersonSkills[7].gold[1] = 1000;
			costPersonSkills[7].gold[2] = 10000;
			costPersonSkills[7].blood[0] = 10;
			costPersonSkills[7].blood[1] = 50;
			costPersonSkills[7].blood[2] = 200;
			costPersonSkills[8].gold[0] = 200;
			costPersonSkills[8].gold[1] = 1000;
			costPersonSkills[8].gold[2] = 10000;
			costPersonSkills[8].blood[0] = 10;
			costPersonSkills[8].blood[1] = 50;
			costPersonSkills[8].blood[2] = 200;
			costPersonSkills[9].gold[0] = 200;
			costPersonSkills[9].gold[1] = 1000;
			costPersonSkills[9].gold[2] = 10000;
			costPersonSkills[9].blood[0] = 2;
			costPersonSkills[9].blood[1] = 20;
			costPersonSkills[9].blood[2] = 100;
			costPersonSkills[10].gold[0] = 200;
			costPersonSkills[10].gold[1] = 1000;
			costPersonSkills[10].gold[2] = 10000;
			costPersonSkills[10].blood[0] = 2;
			costPersonSkills[10].blood[1] = 20;
			costPersonSkills[10].blood[2] = 100;
			costPersonSkills[11].gold[0] = 200;
			costPersonSkills[11].gold[1] = 1000;
			costPersonSkills[11].gold[2] = 10000;
			costPersonSkills[11].blood[0] = 2;
			costPersonSkills[11].blood[1] = 20;
			costPersonSkills[11].blood[2] = 100;
			costPersonSkills[12].gold[0] = 200;
			costPersonSkills[12].gold[1] = 1000;
			costPersonSkills[12].gold[2] = 10000;
			costPersonSkills[12].blood[0] = 2;
			costPersonSkills[12].blood[1] = 20;
			costPersonSkills[12].blood[2] = 100;
			costPersonSkills[13].gold[0] = 200;
			costPersonSkills[13].gold[1] = 1000;
			costPersonSkills[13].gold[2] = 10000;
			costPersonSkills[13].blood[0] = 10;
			costPersonSkills[13].blood[1] = 50;
			costPersonSkills[13].blood[2] = 200;
			costPersonSkills[14].gold[0] = 200;
			costPersonSkills[14].gold[1] = 1000;
			costPersonSkills[14].gold[2] = 10000;
			costPersonSkills[14].blood[0] = 10;
			costPersonSkills[14].blood[1] = 50;
			costPersonSkills[14].blood[2] = 200;
			costPersonSkills[15].gold[0] = 200;
			costPersonSkills[15].gold[1] = 1000;
			costPersonSkills[15].gold[2] = 10000;
			costPersonSkills[15].blood[0] = 0;
			costPersonSkills[15].blood[1] = 0;
			costPersonSkills[15].blood[2] = 0;
			costPersonSkills[16].gold[0] = 200;
			costPersonSkills[16].gold[1] = 1000;
			costPersonSkills[16].gold[2] = 10000;
			costPersonSkills[16].blood[0] = 0;
			costPersonSkills[16].blood[1] = 0;
			costPersonSkills[16].blood[2] = 0;
			costPersonSkills[17].gold[0] = 200;
			costPersonSkills[17].gold[1] = 1000;
			costPersonSkills[17].gold[2] = 10000;
			costPersonSkills[17].blood[0] = 0;
			costPersonSkills[17].blood[1] = 0;
			costPersonSkills[17].blood[2] = 0;
			costPersonSkills[18].gold[0] = 200;
			costPersonSkills[18].gold[1] = 1000;
			costPersonSkills[18].gold[2] = 10000;
			costPersonSkills[18].blood[0] = 0;
			costPersonSkills[18].blood[1] = 0;
			costPersonSkills[18].blood[2] = 0;
			costPersonSkills[19].gold[0] = 200;
			costPersonSkills[19].gold[1] = 1000;
			costPersonSkills[19].gold[2] = 10000;
			costPersonSkills[19].blood[0] = 0;
			costPersonSkills[19].blood[1] = 0;
			costPersonSkills[19].blood[2] = 0;
			costPersonSkills[20].gold[0] = 200;
			costPersonSkills[20].gold[1] = 1000;
			costPersonSkills[20].gold[2] = 10000;
			costPersonSkills[20].blood[0] = 0;
			costPersonSkills[20].blood[1] = 0;
			costPersonSkills[20].blood[2] = 0;
			costPersonSkills[21].gold[0] = 200;
			costPersonSkills[21].gold[1] = 1000;
			costPersonSkills[21].gold[2] = 10000;
			costPersonSkills[21].blood[0] = 0;
			costPersonSkills[21].blood[1] = 0;
			costPersonSkills[21].blood[2] = 0;
			costPersonSkills[22].gold[0] = 200;
			costPersonSkills[22].gold[1] = 1000;
			costPersonSkills[22].gold[2] = 10000;
			costPersonSkills[22].blood[0] = 0;
			costPersonSkills[22].blood[1] = 0;
			costPersonSkills[22].blood[2] = 0;
		}
	}

	public static int[] BuildSDCostMoney;

	static void SetBuildSDCostMoney() {
		if (BuildSDCostMoney == null) {
			BuildSDCostMoney = new int[6];
			BuildSDCostMoney[0] = 0;
			BuildSDCostMoney[1] = 500;
			BuildSDCostMoney[2] = 1000;
			BuildSDCostMoney[3] = 5000;
			BuildSDCostMoney[4] = 7000;
			BuildSDCostMoney[5] = 10000;
		}
	}

}
